package com.zhijiang.hospital.entity.Permission;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * @author 75936
 * @version 1.0
 * @project zhijiang_hospital_datas
 * @description
 * @date 2023-03-21 08:58:48
 */
@Data
public class EmployeeVo {
    //员工编号
    @ApiModelProperty(value = "员工编号")
    private String emplCode;
    //员工手机号码
    @ApiModelProperty("手机号码")
    private String remark;
    //与纳贡部门编号
    @ApiModelProperty("部门编号")
    private String deptCode;
    @ApiModelProperty("员工性别")
    private String sexCode;
    //员工姓名
    @ApiModelProperty("员工姓名")
    private String emplName;
    @ApiModelProperty("员工角色编号")
    private String roleId;
    private List<Role> roles;

    public EmployeeVo(String emplName, List<Role> roles) {
        this.emplName = emplName;
        this.roles = roles;
    }

    public boolean hasPermission(int permission) {
        for (Role role : roles) {
            if (role.hasPermission(permission)) {
                return true;
            }
        }
        return false;
    }


}
